<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Cookie;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
    // 设置cookie
    public function setCookie($key,$value,$time){
        Cookie::queue($key, $value,$time);
        return;
    }
    // 获取cookie
    public function getCookie($key){
        return Cookie::get($key);
    }
    // 清除cookie
    public function delCookie($key){
        Cookie::queue(Cookie::forget($key));
        return ['status' => true];
    }
}
